package com.example.permission.service.impl;

import com.example.permission.dao.BaseMapper;

import com.example.permission.service.BaseService;

import java.util.List;
/**
 * 服务层基类
 * @param <T>
 */
public abstract class BaseServiceImpl<T> implements BaseService<T> {

    protected abstract BaseMapper<T> baseMapper();

    @Override
    public List findAll() {
        return baseMapper().findAll();
    }

    @Override
    public T getIdAll(Integer id) {
        return baseMapper().getIdAll(id);
    }

    @Override
    public Integer add(T t) {
        return baseMapper().add(t);
    }

    @Override
    public Integer update(T t) {
        return baseMapper().update(t);
    }

    @Override
    public Integer delete(Integer id) {
        return baseMapper().delete(id);
    }
}
